package hrm.action.system;

import hrm.action.Action;
import hrm.action.ActionForward;
import hrm.dto.code.CodeDTO;
import hrm.paging.PageUtil;
import hrm.serviceimple.PagingServiceImple;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class SysMenuCodeSearchAction implements Action {
	
	@Override
	public ActionForward execute(HttpServletRequest request,
			HttpServletResponse response) {
		// TODO Auto-generated method stub

		ActionForward actfoward = new ActionForward();
		
		List<CodeDTO> list = null;
		PagingServiceImple service = PagingServiceImple.getInstance();
		try {
			PageUtil.pageContollerHelp(service, request, 10, 10, "getCodeCountPaging", "getAllCodePaging", false);
		} catch (ServletException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		request.setAttribute("list",list);
		actfoward.setUrl("codeList");
		return actfoward;
	}

}
